//package com.jichaoyun.aspect;
//
//
//import com.jichaoyun.model.entity.StationInfo;
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.JoinPoint;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Pointcut;
//import org.springframework.stereotype.Component;
//import org.aspectj.lang.annotation.AfterReturning;
//
//import java.util.Arrays;
//
//@Aspect
//@Component
//@Slf4j
//public class DatabaseOperationAspect {
//
//    // 匹配所有继承 BaseMapper 的 Mapper 的增删改方法
//    @Pointcut("execution(* com.baomidou.mybatisplus.core.mapper.BaseMapper+.insert(..)) || " +
//            "execution(* com.baomidou.mybatisplus.core.mapper.BaseMapper+.delete*(..)) || " +
//            "execution(* com.baomidou.mybatisplus.core.mapper.BaseMapper+.update*(..))")
//    public void databaseOperations() {}
//
//    @AfterReturning("databaseOperations()")
//    public void logDatabaseChange(JoinPoint joinPoint) {
//        String methodName = joinPoint.getSignature().getName();
//        Object[] args = joinPoint.getArgs();
//        //筛选出StationInfo参数
//        for (Object arg : args) {
//            if (arg instanceof StationInfo) {
//                StationInfo stationInfo = (StationInfo) arg;
//                log.info("数据库操作: 方法名={}, StationInfo={}", methodName, stationInfo);
//                log.info("操作站点编号: {}, 站点名称: {}", stationInfo.getStationNo(), stationInfo.getStationName());
//            }
//        }
//    }
//
//}
